package com.yuandian.api.management.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yuandian.api.management.validate.InsertFlag;
import com.yuandian.api.management.validate.UpdateFlag;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 业务配置表-实体
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "业务配置表", description = "")
@TableName("conf_business")
public class ConfBusiness extends BasePage<ConfBusiness> {

	/**
	 * 主键，唯一标识数据
	 */
	@NotNull(message = "业务id不能为空", groups = UpdateFlag.class)
	@Digits(integer = Integer.MAX_VALUE, fraction = 0, message = "业务id必须为整数", groups = InsertFlag.class)
	@ApiModelProperty(value = "主键", notes = "主键，唯一标识数据")
	@TableId(type = IdType.AUTO)
	private Integer id;

	/**
	 * 所属系统id
	 */
	@ApiModelProperty(value = "所属系统id", notes = "所属系统id")
	@NotNull(message = "所属系统id不能为空", groups = InsertFlag.class)
	private Integer systemId;

	/**
	 * 业务编码
	 */
	@ApiModelProperty(value = "业务编码", notes = "业务编码")
	private String businessCode;

	/**
	 * 步骤类型，1：首步骤、2：中间步骤、3：末步骤
	 */
	@ApiModelProperty(value = "步骤类型", notes = "步骤类型，1：首步骤、2：中间步骤、3：末步骤")
	@TableField(exist = false)
	private Integer type;

	/**
	 * 业务名称
	 */
	@NotNull(message = "业务名称不能为空")
	@NotBlank(message = "业务名称不能为空", groups = InsertFlag.class)
	@ApiModelProperty(value = "业务名称", notes = "业务名称")
	private String name;

	/**
	 * 是否确认，0：否(默认)、1：是
	 */
	@ApiModelProperty(value = "是否确认", notes = "是否确认，0：否(默认)、1：是")
	private Integer isConfirm;

	/**
	 * 是否启用，0：否(默认)、1：是
	 */
	@ApiModelProperty(value = "是否启用", notes = "是否启用，0：否(默认)、1：是")
	private Integer isEnable;

	/**
	 * 是否为关键业务，0：否(默认)、1：是
	 */
	@ApiModelProperty(value = "是否为关键业务", notes = "是否为关键业务，0：否(默认)、1：是")
	@NotNull(message = "是否为关键业务不能为空", groups = InsertFlag.class)
	private Integer isKey;

	/**
	 * 显示顺序
	 */
	@ApiModelProperty(value = "显示顺序", notes = "显示顺序")
	private Integer sequence;

	/**
	 * 创建人
	 */
	@ApiModelProperty(value = "创建人", notes = "创建人")
	private String createBy;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间", notes = "创建时间")
	private LocalDateTime createTime;

	/**
	 * 更新人
	 */
	@ApiModelProperty(value = "更新人", notes = "更新人")
	private String updateBy;

	/**
	 * 更新时间
	 */
	@ApiModelProperty(value = "更新时间", notes = "更新时间")
	private LocalDateTime updateTime;

	/**
	 * 是否逻辑删除，0：否、1：是
	 */
	@ApiModelProperty(value = "是否逻辑删除", notes = "是否逻辑删除，0：否、1：是")
	private Integer isDel;

	/**
	 * 备注
	 */
	@ApiModelProperty(value = "备注", notes = "备注")
	private String remarks;

	/**
	 * 该业务下的步骤集合
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "该业务下的步骤集合", notes = "该业务下的步骤集合")
	private List<ConfStep> stepList;

}
